{extend name="admin@public/main"}
{block name="buttons"}
{if hasAuth('admin/auth/add')}
<button class = "btn btn-sm btn-outline-primary" data-action="dialog" data-action-url="{:url('admin/code/add')}" data-dialog-title="新增">新建</button>
{/if}
{/block}
{block name="content"}
<table class = "table">
    <thead>
    <tr class = "title">
        <th>表名称</th>
        <th>模块名称</th>
        <th>控制器</th>
        <th>URL</th>
        <th>生成时间</th>
        <th>操作</th>
    </tr>
    </thead>
    <tbody>
    {volist name="list" id="vo"}
    <tr>
        <td>{$vo.table_name}</td>
        <td>{$vo.package}</td>
        <td>{$vo.controller_name}</td>
        <td>{$vo.url}</td>
        <td>{$vo.addtime}</td>
        <td>
            {if hasAuth('admin/code/del')}
            <span class="text-explode">|</span>
            <a class = "user-option" data-action = "ajax" data-action-url="{:url('admin/code/del')}"
               data-action-params = '{"id":{$vo.id},"field":"delete"}' data-action-ask = "是否确定删除控制器:{$vo.controller_name}" data-action-method = "post">删除</a>
            {/if}
        </td>
    </tr>
    {/volist}
    </tbody>
</table>
{/block}